package com.petlab.action;

import javax.annotation.Resource;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import com.opensymphony.xwork2.ActionSupport;
import com.petlab.model.Article;
import com.petlab.service.NewTopicService;

@Component("newTopicAction")
@Scope("prototype")
public class NewTopicAction extends ActionSupport {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private Article article;
	private NewTopicService newTopicService;

	public NewTopicService getNewTopicService() {
		return newTopicService;
	}

	@Resource
	public void setNewTopicService(NewTopicService newTopicService) {
		this.newTopicService = newTopicService;
	}

	public Article getArticle() {
		return article;
	}

	public void setArticle(Article article) {

		this.article = article;
	}


	public String createArticlePage() {
		newTopicService.createArticlePage(article);
		
		return SUCCESS;
	}

	public String execute() throws Exception {
		return createArticlePage();

	}

}
